<?php
$this->breadcrumbs = array(
    'Products' => array('admin'),
    $model->name,
);

$this->menu = array(
    array('label' => 'List Product', 'url' => array('index')),
    array('label' => 'Create Product', 'url' => array('create')),
    array('label' => 'Update Product', 'url' => array('update', 'id' => $model->productId)),
    array('label' => 'Delete Product', 'url' => '#', 'linkOptions' => array('submit' => array('delete', 'id' => $model->productId), 'confirm' => 'Are you sure you want to delete this item?')),
    array('label' => 'Manage Product', 'url' => array('admin')),
);
$this->headTitle = "View Product Details";
?>

<div class="widget">
    <div class="head">
        <h5 class="iFrames">Product <?php echo $model->name; ?></h5>
    </div>
    <div class="body">

        <?php
        $this->widget('zii.widgets.CDetailView', array(
            'data' => $model,
            'cssFile' => Yii::app()->baseUrl . Constant::CDETAILVIEW_CSS_URL,
            'attributes' => array(
                'productId',
                'name',
                'description',
                'price',
                'cost',
                'quantity',
                'hardCover',
                'publisher',
                'language',
                'author',
                'publicationDate',
                'dimensions',
                array(
                    'name' => 'createdUserId',
                    'value' => Helper::getUserNameById($model->createdUserId),
                ),
                'createdDate',
                array(
                    'name' => 'updatedUserId',
                    'value' => Helper::getUserNameById($model->updatedUserId),
                ),
                'updatedDate',
                array(
                    'type' => 'html',
                    'name' => 'smallImgUrl',
                    'value' => CHtml::image(Yii::app()->baseUrl . Constant::PRODUCT_SMALL_IMG_FOLDER_DISPLAY . $model->smallImgUrl, "", array("width" => "50", "height" => "50")),
                ),
                array(
                    'type' => 'html',
                    'name' => 'bigImgUrl',
                    'value' => CHtml::image(Yii::app()->baseUrl . Constant::PRODUCT_BIG_IMG_FOLDER_DISPLAY . $model->bigImgUrl, "", array("width" => "300", "height" => "300")),
                ),
                'viewCount',
                'status',
                array(
                    'name' => 'productCategoryId',
                    'value' => Helper::getProductCategoryNameById($model->productCategoryId),
                ),
                array(
                    'name' => 'isDeleted',
                    'value' => Helper::getYesNoText($model->isDeleted),
                ),
            ),
        ));
        echo Helper::renderCrudToolTrashIncluded("product", "productId", $model->productId, $model->isDeleted);
        ?>
    </div>
</div>
